import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";
import Layout from "../views/Layout.vue";
import Console from "../views/console/index.vue";

const routes = [
  {
    path: "/login",
    component: () => import("@/views/login.vue"),
    hidden: true,
  },
  {
    path: "/",
    name: "Layout",
    component: Layout,
    redirect: "/product",
    children: [
      {
        path: "/home",
        name: "home",
        component: HomeView,
      },
      {
        path: "/proview",
        name: "proview",
        component: () => import("../views/ProView.vue"),
      },
      {
        path: "/product",
        name: "product",
        component: () => import("@/views/product/index.vue"),
      },
      {
        path: "/product/detail",
        name: "productDetail",
        component: () => import("@/views/product/detail.vue"),
      },
      {
        path: "/service",
        name: "service",
        component: () => import("@/views/service/index.vue"),
      },
      {
        path: "/service/detail",
        name: "serviceDetail",
        component: () => import("@/views/service/detail.vue"),
      },
      {
        path: "/case",
        name: "case",
        component: () => import("@/views/case/index.vue"),
      },
      {
        path: "/case/detail",
        name: "caseDetail",
        component: () => import("@/views/case/detail.vue"),
      },
      {
        path: "/download",
        name: "download",
        component: () => import("@/views/download/index.vue"),
      },
      {
        path: "/about",
        name: "about",
        component: () => import("@/views/about/index.vue"),
      },
      {
        path: "/about/detail",
        name: "aboutDetail",
        component: () => import("@/views/about/detail.vue"),
      },
      {
        path: "/award",
        name: "award",
        component: () => import("@/views/award/index.vue"),
      },
      {
        path: "/partner",
        name: "partner",
        component: () => import("@/views/partner/index.vue"),
      },
      {
        path: "/console",
        name: "Console",
        component: Console,
        meta: {
          title: "工作台",
        },
      },
    ],
  },
  
  {
    path: "/home/articleDetail",
    name: "homeArticleDetail",
    component: () => import('@/views/articleDetail/index.vue')
  },
  {
    path: "/product/articleDetail",
    name: "productArticleDetail",
    component: () => import('@/views/articleDetail/index.vue')
  },
  {
    path: "/service/articleDetail",
    name: "serviceArticleDetail",
    component: () => import('@/views/articleDetail/index.vue')
  },
  {
    path: "/case/articleDetail",
    name: "caseArticleDetail",
    component: () => import('@/views/articleDetail/index.vue')
  },
  {
    path: "/about/articleDetail",
    name: "caseArticleDetail",
    component: () => import('@/views/articleDetail/index.vue')
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
